package cn.zust.edu.cn;
/**
 * 
 * @author czg
 * @since 2023/3/7 10:50
 */
<<<<<<< HEAD
public class Rectangle {
}
=======
public class Rectangle implements IShape {
    private Point ptTopLeft;
    private Point ptTopRight;
    private int width;
    private int height;

    public Rectangle() {
        this.ptTopLeft = new Point(0, 0);
        this.width = 0;
        this.height = 0;
        this.ptTopRight = new Point(width, 0);
    }

    public Rectangle(Point topLeft, int height, int width) {
        this.ptTopLeft = topLeft;
        this.width = width;
        this.height = height;
        this.ptTopRight = new Point(topLeft.getX() + width, topLeft.getY());
    }

    @Override
    public double perimeter() {
        return 2 * (width + height);
    }

    @Override
    public double area() {
        return width * height;
    }

    @Override
    public void draw() {
        System.out.println("矩形宽: " + width + ", 高: " + height);
    }
}

>>>>>>> 2fc5c55 (ss)
